import { createSSRApp } from "vue";
wx.cloud.init();
import App from "./App.vue";
import en from './locales/en.json'
import zhHans from './locales/zh-Hans.json'
import zhHant from './locales/zh-Hant.json'
import { createI18n } from 'vue-i18n'// v9.x

const i18n = createI18n({
  
  warnHtmlInMessage: false,
  fallbackWarn: false,
  missingWarn: false,
  legacy: true,
  // locale: uni.getLocale(),// 获取已设置的语言
  locale: 'zh-Hant',// 获取已设置的语言
  messages: {
    'en-US': en,
    'zh-Hans': zhHans,
    'zh-Hant': zhHant,
    'zh': zhHant,
  },
  loggerLevel: 'silent',
  missing: (locale, key, vm) => {
    return key; // 返回 key，而不是显示警告
  }
})



export function createApp() {
  const app = createSSRApp(App);
  app.use(i18n)
  return {
    app,
  };
}
